<!--上传弹窗-->
<template>
    <el-dialog v-model="popData.show" title="导出" center width="30%">
        <el-form ref="formRef" label-width="80px" class="demo-ruleForm">
            <el-form-item label="起止时间" prop="endDate">
                <el-date-picker v-model="startDate" type="date" placeholder="开始" value-format="YYYY-MM-DD" />
                &nbsp;
                <el-date-picker v-model="endDate" type="date" placeholder="结束" value-format="YYYY-MM-DD" />
            </el-form-item>

            <el-form-item>
                <div class="buttons">
                    <el-button type="primary" @click="commit">提交</el-button>
                </div>
            </el-form-item>
        </el-form>
    </el-dialog>
</template>

<script setup lang="ts">
import {defineProps, ref} from 'vue'

const startDate = ref()
const endDate   = ref()

const emit = defineEmits(["commitDone"])

const props = defineProps({
    popData: {
        type   : Object,
        default: () => {
            return {
                show: false,
            }
        }
    }
})

/**
 * 保存
 */
function commit() {
    props.popData.show = false
    emit("commitDone", [startDate.value, endDate.value])
}

</script>

<style lang="scss" scoped>
.buttons {
    width: 100%;
    display: flex;
    justify-content: end;
    align-items: end;
}
</style>
